package com.gds.wiki.cloud.orderCenter.server.modular.order.impl;

import com.gds.wiki.cloud.framework.common.dto.ResponseDto;
import com.gds.wiki.cloud.framework.common.exception.BizExceptionEnum;
import com.gds.wiki.cloud.framework.common.utils.ResponseDtoFactory;
import com.gds.wiki.cloud.framework.web.common.BaseController;
import com.gds.wiki.cloud.orderCenter.client.order.api.OrderApi;
import com.gds.wiki.cloud.orderCenter.client.order.model.Order;
import com.gds.wiki.cloud.orderCenter.server.modular.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(OrderApi.mapping)
public class OrderApiImpl extends BaseController implements OrderApi {

    @Autowired
    private OrderService orderService;

    @Override
    public ResponseDto getBySelf(Order order) {
        ResponseDto responseDto= ResponseDtoFactory.GetInstance().build(BizExceptionEnum.API_EEROR);
        order=orderService.getBySelf(order);
        responseDto.setData(order);
        return responseDto;
    }

    @Override
    public ResponseDto asd() {
        return new ResponseDto();
    }
}
